package com.config;


import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc;


@Configuration
@EnableSwagger2WebMvc
@EnableKnife4j
public class Knife4jConfiguration {

    @Bean(value = "basicesApi")
    public Docket basicesApi() {
        Docket docket = new Docket(DocumentationType.SWAGGER_2).enable(true)
                .apiInfo(new ApiInfoBuilder()
                        .description("系统基础管理接口文档")
                        .termsOfServiceUrl("http://www.xx.com/")
                        .version("2.0")
                        .title("系统基础管理接口文档")
                        .description("系统基础管理接口")
                        .build())
                //分组名称
                .groupName("basicesApi")
                .select()
                //这里指定Controller扫描包路径
                .apis(RequestHandlerSelectors.basePackage("com.controller"))
                .build();
        return docket;
    }

}
